// pages/2.2/view/index.js
Page({
    /**
     * 页面的初始数据
     */
    data: {
        nickName: '',
        avatarUrl: '',
        isCanDraw: false
    },

    onLoad() {
        this.setData({
            nickName: wx.getStorageSync('nickName') || '',
            avatarUrl: wx.getStorageSync('avatarUrl') || ''
        })
    },

    getUserInfo(e) {
        this.setData({
            nickName: e.detail.userInfo.nickName,
            avatarUrl: e.detail.userInfo.avatarUrl
        })
        wx.setStorageSync('avatarUrl', e.detail.userInfo.avatarUrl)
        wx.setStorageSync('nickName', e.detail.userInfo.nickName)
    },

    createShareImage() {
        this.setData({
            isCanDraw: !this.data.isCanDraw
        })
    },

    onTap(e) {
        console.log(e.target);
    },
});